import request from '@/utils/request'

// 查询设备分类列表
export function listCategory(query) {
    return request({
        url: '/equipment/category/listAll',
        method: 'get',
        params: query
    })
}

// 查询设备分类详细
export function getCategory(equipmentCategoryId) {
    return request({
        url: '/equipment/category/' + equipmentCategoryId,
        method: 'get'
    })
}

// 新增设备分类
export function addCategory(data) {
    return request({
        url: '/equipment/category',
        method: 'post',
        data: data
    })
}

// 修改设备分类
export function updateCategory(data) {
    return request({
        url: '/equipment/category',
        method: 'put',
        data: data
    })
}

// 删除设备分类
export function delCategory(equipmentCategoryId) {
    return request({
        url: '/equipment/category/' + equipmentCategoryId,
        method: 'delete'
    })
}

// 用户状态修改
export function updateCategoryStatus(equipmentCategoryId, status) {
    const data = {
        equipmentCategoryId,
        status
    }
    return request({
        url: '/equipment/category/',
        method: 'put',
        data: data
    })
}
